3.2.7 \(\int \frac {\sec ^7(c+d x)}{a+i a \tan (c+d x)} \, dx\) [107]

Optimal. Leaf size=84 \[ \frac {3 \tanh ^{-1}(\sin (c+d x))}{8 a d}-\frac {i \sec ^5(c+d x)}{5 a d}+\frac {3 \sec (c+d x) \tan (c+d x)}{8 a d}+\frac {\sec ^3(c+d x) \tan (c+d x)}{4 a d} \]

[Out]

3/8*arctanh(sin(d*x+c))/a/d-1/5*I*sec(d*x+c)^5/a/d+3/8*sec(d*x+c)*tan(d*x+c)/a/d+1/4*sec(d*x+c)^3*tan(d*x+c)/a
/d

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 84, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3582, 3853, 3855} \begin {gather*} -\frac {i \sec ^5(c+d x)}{5 a d}+\frac {3 \tanh ^{-1}(\sin (c+d x))}{8 a d}+\frac {\tan (c+d x) \sec ^3(c+d x)}{4 a d}+\frac {3 \tan (c+d x) \sec (c+d x)}{8 a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^7/(a + I*a*Tan[c + d*x]),x]

[Out]

(3*ArcTanh[Sin[c + d*x]])/(8*a*d) - ((I/5)*Sec[c + d*x]^5)/(a*d) + (3*Sec[c + d*x]*Tan[c + d*x])/(8*a*d) + (Se
c[c + d*x]^3*Tan[c + d*x])/(4*a*d)

Rule 3582

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[d^2*(
d*Sec[e + f*x])^(m - 2)*((a + b*Tan[e + f*x])^(n + 1)/(b*f*(m + n - 1))), x] + Dist[d^2*((m - 2)/(a*(m + n - 1
))), Int[(d*Sec[e + f*x])^(m - 2)*(a + b*Tan[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f}, x] && EqQ[a^2
 + b^2, 0] && LtQ[n, 0] && GtQ[m, 1] &&  !ILtQ[m + n, 0] && NeQ[m + n - 1, 0] && IntegersQ[2*m, 2*n]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {\sec ^7(c+d x)}{a+i a \tan (c+d x)} \, dx &=-\frac {i \sec ^5(c+d x)}{5 a d}+\frac {\int \sec ^5(c+d x) \, dx}{a}\\ &=-\frac {i \sec ^5(c+d x)}{5 a d}+\frac {\sec ^3(c+d x) \tan (c+d x)}{4 a d}+\frac {3 \int \sec ^3(c+d x) \, dx}{4 a}\\ &=-\frac {i \sec ^5(c+d x)}{5 a d}+\frac {3 \sec (c+d x) \tan (c+d x)}{8 a d}+\frac {\sec ^3(c+d x) \tan (c+d x)}{4 a d}+\frac {3 \int \sec (c+d x) \, dx}{8 a}\\ &=\frac {3 \tanh ^{-1}(\sin (c+d x))}{8 a d}-\frac {i \sec ^5(c+d x)}{5 a d}+\frac {3 \sec (c+d x) \tan (c+d x)}{8 a d}+\frac {\sec ^3(c+d x) \tan (c+d x)}{4 a d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.43, size = 60, normalized size = 0.71 \begin {gather*} \frac {240 \tanh ^{-1}\left (\sin (c)+\cos (c) \tan \left (\frac {d x}{2}\right )\right )+\sec ^5(c+d x) (-64 i+70 \sin (2 (c+d x))+15 \sin (4 (c+d x)))}{320 a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^7/(a + I*a*Tan[c + d*x]),x]

[Out]

(240*ArcTanh[Sin[c] + Cos[c]*Tan[(d*x)/2]] + Sec[c + d*x]^5*(-64*I + 70*Sin[2*(c + d*x)] + 15*Sin[4*(c + d*x)]
))/(320*a*d)

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 205 vs. \(2 (75 ) = 150\).
time = 0.30, size = 206, normalized size = 2.45

method result size
risch \(-\frac {i \left (15 \,{\mathrm e}^{9 i \left (d x +c \right )}+70 \,{\mathrm e}^{7 i \left (d x +c \right )}+128 \,{\mathrm e}^{5 i \left (d x +c \right )}-70 \,{\mathrm e}^{3 i \left (d x +c \right )}-15 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{20 d a \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{5}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 a d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 a d}\) \(122\)
derivativedivides \(\frac {\frac {i}{5 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{5}}+\frac {2 \left (\frac {7}{16}+\frac {5 i}{16}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {2 \left (\frac {5}{16}+\frac {3 i}{16}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+\frac {2 \left (\frac {1}{4}+\frac {3 i}{8}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}+\frac {2 \left (\frac {1}{8}+\frac {i}{4}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{4}}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8}-\frac {i}{5 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{5}}+\frac {2 \left (\frac {5}{16}-\frac {3 i}{16}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}+\frac {2 \left (\frac {1}{4}-\frac {3 i}{8}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {2 \left (-\frac {1}{8}+\frac {i}{4}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{4}}+\frac {2 \left (-\frac {7}{16}+\frac {5 i}{16}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8}}{d a}\) \(206\)
default \(\frac {\frac {i}{5 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{5}}+\frac {2 \left (\frac {7}{16}+\frac {5 i}{16}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {2 \left (\frac {5}{16}+\frac {3 i}{16}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+\frac {2 \left (\frac {1}{4}+\frac {3 i}{8}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}+\frac {2 \left (\frac {1}{8}+\frac {i}{4}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{4}}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8}-\frac {i}{5 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{5}}+\frac {2 \left (\frac {5}{16}-\frac {3 i}{16}\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}+\frac {2 \left (\frac {1}{4}-\frac {3 i}{8}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}+\frac {2 \left (-\frac {1}{8}+\frac {i}{4}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{4}}+\frac {2 \left (-\frac {7}{16}+\frac {5 i}{16}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8}}{d a}\) \(206\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^7/(a+I*a*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

2/d/a*(1/10*I/(tan(1/2*d*x+1/2*c)-1)^5+(7/16+5/16*I)/(tan(1/2*d*x+1/2*c)-1)^2+(5/16+3/16*I)/(tan(1/2*d*x+1/2*c
)-1)+(1/4+3/8*I)/(tan(1/2*d*x+1/2*c)-1)^3+(1/8+1/4*I)/(tan(1/2*d*x+1/2*c)-1)^4-3/16*ln(tan(1/2*d*x+1/2*c)-1)-1
/10*I/(tan(1/2*d*x+1/2*c)+1)^5+(5/16-3/16*I)/(tan(1/2*d*x+1/2*c)+1)+(1/4-3/8*I)/(tan(1/2*d*x+1/2*c)+1)^3+(-1/8
+1/4*I)/(tan(1/2*d*x+1/2*c)+1)^4+(-7/16+5/16*I)/(tan(1/2*d*x+1/2*c)+1)^2+3/16*ln(tan(1/2*d*x+1/2*c)+1))

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 288 vs. \(2 (74) = 148\).
time = 0.30, size = 288, normalized size = 3.43 \begin {gather*} -\frac {3 \, {\left (\frac {16 \, {\left (\frac {25 i \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {10 i \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {80 \, \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {10 i \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} + \frac {40 \, \sin \left (d x + c\right )^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}} - \frac {25 i \, \sin \left (d x + c\right )^{9}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{9}} + 8\right )}}{-120 i \, a + \frac {600 i \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {1200 i \, a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {1200 i \, a \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} - \frac {600 i \, a \sin \left (d x + c\right )^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}} + \frac {120 i \, a \sin \left (d x + c\right )^{10}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{10}}} - \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} + \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a}\right )}}{8 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^7/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

-3/8*(16*(25*I*sin(d*x + c)/(cos(d*x + c) + 1) - 10*I*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 + 80*sin(d*x + c)^4/
(cos(d*x + c) + 1)^4 + 10*I*sin(d*x + c)^7/(cos(d*x + c) + 1)^7 + 40*sin(d*x + c)^8/(cos(d*x + c) + 1)^8 - 25*
I*sin(d*x + c)^9/(cos(d*x + c) + 1)^9 + 8)/(-120*I*a + 600*I*a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - 1200*I*a*
sin(d*x + c)^4/(cos(d*x + c) + 1)^4 + 1200*I*a*sin(d*x + c)^6/(cos(d*x + c) + 1)^6 - 600*I*a*sin(d*x + c)^8/(c
os(d*x + c) + 1)^8 + 120*I*a*sin(d*x + c)^10/(cos(d*x + c) + 1)^10) - log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)
/a + log(sin(d*x + c)/(cos(d*x + c) + 1) - 1)/a)/d

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 266 vs. \(2 (74) = 148\).
time = 0.40, size = 266, normalized size = 3.17 \begin {gather*} \frac {15 \, {\left (e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) - 15 \, {\left (e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right ) - 30 i \, e^{\left (9 i \, d x + 9 i \, c\right )} - 140 i \, e^{\left (7 i \, d x + 7 i \, c\right )} - 256 i \, e^{\left (5 i \, d x + 5 i \, c\right )} + 140 i \, e^{\left (3 i \, d x + 3 i \, c\right )} + 30 i \, e^{\left (i \, d x + i \, c\right )}}{40 \, {\left (a d e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, a d e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, a d e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, a d e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^7/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/40*(15*(e^(10*I*d*x + 10*I*c) + 5*e^(8*I*d*x + 8*I*c) + 10*e^(6*I*d*x + 6*I*c) + 10*e^(4*I*d*x + 4*I*c) + 5*
e^(2*I*d*x + 2*I*c) + 1)*log(e^(I*d*x + I*c) + I) - 15*(e^(10*I*d*x + 10*I*c) + 5*e^(8*I*d*x + 8*I*c) + 10*e^(
6*I*d*x + 6*I*c) + 10*e^(4*I*d*x + 4*I*c) + 5*e^(2*I*d*x + 2*I*c) + 1)*log(e^(I*d*x + I*c) - I) - 30*I*e^(9*I*
d*x + 9*I*c) - 140*I*e^(7*I*d*x + 7*I*c) - 256*I*e^(5*I*d*x + 5*I*c) + 140*I*e^(3*I*d*x + 3*I*c) + 30*I*e^(I*d
*x + I*c))/(a*d*e^(10*I*d*x + 10*I*c) + 5*a*d*e^(8*I*d*x + 8*I*c) + 10*a*d*e^(6*I*d*x + 6*I*c) + 10*a*d*e^(4*I
*d*x + 4*I*c) + 5*a*d*e^(2*I*d*x + 2*I*c) + a*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {i \int \frac {\sec ^{7}{\left (c + d x \right )}}{\tan {\left (c + d x \right )} - i}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**7/(a+I*a*tan(d*x+c)),x)

[Out]

-I*Integral(sec(c + d*x)**7/(tan(c + d*x) - I), x)/a

________________________________________________________________________________________

Giac [A]
time = 0.58, size = 138, normalized size = 1.64 \begin {gather*} \frac {\frac {15 \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a} - \frac {15 \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}{a} + \frac {2 \, {\left (25 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 40 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} - 10 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 80 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 10 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 25 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 8 i\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{5} a}}{40 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^7/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

1/40*(15*log(tan(1/2*d*x + 1/2*c) + 1)/a - 15*log(tan(1/2*d*x + 1/2*c) - 1)/a + 2*(25*tan(1/2*d*x + 1/2*c)^9 +
 40*I*tan(1/2*d*x + 1/2*c)^8 - 10*tan(1/2*d*x + 1/2*c)^7 + 80*I*tan(1/2*d*x + 1/2*c)^4 + 10*tan(1/2*d*x + 1/2*
c)^3 - 25*tan(1/2*d*x + 1/2*c) + 8*I)/((tan(1/2*d*x + 1/2*c)^2 - 1)^5*a))/d

________________________________________________________________________________________

Mupad [B]
time = 7.01, size = 193, normalized size = 2.30 \begin {gather*} \frac {3\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{4\,a\,d}+\frac {\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{2\,a}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{2\,a}+\frac {5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9}{4\,a}-\frac {5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4\,a}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,4{}\mathrm {i}}{a}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,2{}\mathrm {i}}{a}+\frac {2{}\mathrm {i}}{5\,a}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(c + d*x)^7*(a + a*tan(c + d*x)*1i)),x)

[Out]

(3*atanh(tan(c/2 + (d*x)/2)))/(4*a*d) + (tan(c/2 + (d*x)/2)^3/(2*a) + (tan(c/2 + (d*x)/2)^4*4i)/a - tan(c/2 +
(d*x)/2)^7/(2*a) + (tan(c/2 + (d*x)/2)^8*2i)/a + (5*tan(c/2 + (d*x)/2)^9)/(4*a) + 2i/(5*a) - (5*tan(c/2 + (d*x
)/2))/(4*a))/(d*(5*tan(c/2 + (d*x)/2)^2 - 10*tan(c/2 + (d*x)/2)^4 + 10*tan(c/2 + (d*x)/2)^6 - 5*tan(c/2 + (d*x
)/2)^8 + tan(c/2 + (d*x)/2)^10 - 1))

________________________________________________________________________________________